//
// loi2.cpp for 202loi in /home/morel_t//Rendu/maths/202loi
// 
// Made by thomas morel
// Login   <morel_t@epitech.net>
// 
// Started on  Fri Mar  9 15:45:50 2012 thomas morel
// Last update Fri Mar  9 17:50:22 2012 thomas morel
//

#include "202loi.h"

double		variance_x(std::string **tab)
{
  double	result = 0;

  for (int x = 1; x <= 5; x++)
    result += (toDouble(tab[6][x]) * x * x);

  result -= (esperance_x(tab) * esperance_x(tab));
  return (result);
}

double		variance_y(std::string **tab)
{
  double	result = 0;

  for (int y = 1; y <= 5; y++)
    result += (toDouble(tab[y][6]) * y * y);

  result -= (esperance_y(tab) * esperance_y(tab));
  return (result);
}

